<template>
  <div>
    <el-button type="primary" size="default" @click="changeFather"
      >改变父亲列表
    </el-button>
    <el-button type="primary" size="default" @click="changeName"
      >改变name
    </el-button>
    <div>{{ props.aaaa }}</div>
    <test2Child></test2Child>
  </div>
</template>

<script setup>
import test2Child from "./test2Child";
import { ref, onMounted } from "vue";

const props = defineProps({
  aaaa: String,
});
const emitFun = defineEmits(["changeA", "changeName"]);

const changeName = () => {
  emitFun("changeName");
};

const changeFather = () => {
  emitFun("changeA");
};

const test = (val) => {
  console.log(val);
};
const test2 = (val) => {
  console.log(val);
};
defineExpose({
  test,
  test2,
});
</script>

<style lang="less" scoped></style>
